package cn.edu.ctbu.studentmanage.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *  针对tb_course的实体类
 */
//取对象命一般小写
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Entity(name = "tb_course")
public class Course {
    /**
     * 序号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer cid;
    /**
     * 课程编号
     */
    @NotNull
    @Size(min = 5,max = 10,message="课程编号最少5位")
    private String cno;

    /**
     * 课程名
     */
    @NotNull
    private String cname;


    /**
     * 学时
     */
    private Integer chours;


    /**
     * 学分
     */
    private Integer ccredit;
}
